Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Support for Sound Capture at Any Sample Rate

QuickTime 2.5 enhanced the sequence grabber sound channel to allow sound to be captured at any sample rate. The sample rate is specified, as in the past, by using SGSetSoundInputRate . If the requested rate is not one of the hardware rates, the sound will be captured using the closest available hardware sample rate and will be rate-converted in software to the requested rate.

In most cases, sound capture hardware does not run at the same clock rate as the motherboard crystal used to generate time stamps. Sound capture hardware also rarely runs on the same clock as video capture hardware. Over time, drift between these clocks can result in the loss of synchronization between sound and video.

QuickTime measures the drift over the duration of the capture and applies an adjustment to the sample rate of the audio to keep things synchronized. In nearly all cases, this is the right thing to do. If your hardware really knows that it always captures at the correct sample rate, it can tell QuickTime not to adjust the sample rate.

To prohibit adjustment of the sample rate, implement the 'qtrt' resource in your sound input device's GetInfo routine. The argument passed is a pointer to a short . Set the short to true to indicate you don't want sample rate adjustment to be applied.


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |